home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: Big and little endians
- Date: 16 Feb 1996 18:44:00 GMT
- Organization: OpenVision
- Message-ID: <4g2j9g$ir2@spanky.pls.ov.com>
- References: <4fuuqq$fpp@due.unit.no>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article fpp@due.unit.no, Vidar Moe <vidarm@ibt.unit.no> writes:
- >What exactly is meant by the terms little-endians and
- >big-endians?
- >
- >Vidar Moe.
- >
- >
-
- First of all, the terms are derived from Johnathon Swift's "Gulliver's
- Travels" referring to the reason behind the war between Lilliput and
- Blefesceu. These two cities were warring over which end of a soft
- boiled egg should be opened to eat it. One city said the "big end" and
- the other said the "little end". The terms now are used to refer to
- those who defend a dogma without good reason.
-
- As it applies to computers, the terms refer to the ordering of bytes
- in a computer word. Dec and Intel use the "Big-Endian" order, and
- Motorola and SPARC use the "Little-Endian" order.
-
- The "Little-Endian" order places the lowest addressed byte in the high
- end of the word, and then next higher addressed byte to the next lower
- position. Thus if you examine a string in memory, you will see the
- bytes in the same order as they would appear in a word.
-
- In ancient times, word size and byte ordering would be detected by sending
- a 4 character word. The UNIX world used the word UNIX. The receiving
- end would examine the word, and if it got UNIX, then the machines had
- the same byte ordering. If the machine got XINU, then
- the word size was 4 bytes, but the byte order was opposite (the other
- endian). Similarly, if the word was NUXI then the word size was two
- bytes and opposite byte ordering. Clearly, you could not detect the
- difference between 2 byte and 4 byte words if the machines had the
- same byte ordering.
-
- Fletcher.Glenn@ov.com
-
-